<?php
if ($is_ctcp && ($command == 'PRIVMSG') && ($ctcp_command == 'ACTION') && ($ctcp_args[1] == 'feeds')){
	if(stristr($ctcp_msg, $nickname)){
		$eatItem = str_replace('ACTION feeds', '', $ctcp_msg);
		$eatItem = str_ireplace("to $nickname", '', $eatItem);
		$eatItem = str_ireplace($nickname, '', $eatItem);
		$eatItem = str_ireplace(' a ', ' the ', $eatItem);
		$eatItem = trim($eatItem);
		$eatResponses = Array(
			"ACTION eats $eatItem",
			'ACTION eats it',
			"ACTION eats $eatItem, just to barf it up on $source_nick's shoe",
			'EWWW!!!!!! IT\'S OLD!!!!!',
			"ACTION barfs $eatItem up on the floor at $source_nick's feet",
			"ACTION refuses to eat $eatItem, and puts it down the garbage disposal instead",
			'ACTION doesn\'t think that\'ll taste good and gives it to Xando... XANDO WONT EAT IT?! OH NOES'
		);
		$randInt=rand(0, sizeOf($eatResponses) - 1);
		$eatResponse = $eatResponses[$randInt];
		while(stristr($eatResponse, '  ')){
			$eatResponse = str_replace('  ', ' ', $eatResponse);
		}
		if(!empty($eatItem)){
			if(substr(strtolower($eatItem), 0, 3) == 'to '){
				$eatItem = str_replace('to ', '', $eatItem);
				action("eats $eatItem first");
			} else if(substr($eatResponse, 0, 7) == 'ACTION '){
				ctcp_request($eatResponse);
			} else {
				msg($eatResponse);
			}
		}
	}
}
?>